<?php $this->load->view('common/head');?>

<?php $this->load->view('common/header');?>
<?php echo admin_js_url('admin-order');?>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <?php $this->load->view('common/sidebar');?>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <?php $this->load->view('common/breadcrumbs');?>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">

                <?php $this->load->view('common/set');?>
                <div class="row">
                    <div class="col-sm-12 widget-container-col ui-sortable" id="widget-container-col-10">
                        <div class="widget-box ui-sortable-handle" id="widget-box-10">
                            <div class="widget-header widget-header-small">
                                <h5 class="widget-title smaller">下单信息</h5>
                            </div>

                            <div class="widget-body">
                                <div class="widget-main padding-6" style="overflow: hidden">
                                    <div class="tab-content">
                                            <div class="col-xs-12">
                                                <!-- PAGE CONTENT BEGINS -->
                                                <form class="form-horizontal" action="<?php echo site_url(X_URL.'orders/create');?>" method="post" id="from1" >
                                                    <?php echo csrf_hidden();?>

                                                    <div class="order_box">

                                                        <div class="space-4"></div>
                                                        <div class="form-group">
                                                            <label class="col-sm-1 control-label no-padding-right" for="form-field-2">选择产品</label>
                                                            <div class="col-sm-1">
                                                                <select name="category_id[]" class="category_id">
                                                                    <option value="0">请选择产品类型</option>
                                                                    <?php if(isset($cates)){?>
                                                                        <?php foreach ($cates as $k => $v) {?>
                                                                            <option value="<?php echo $v['id'] ?>"><?php echo $v['category_name'] ?></option>
                                                                        <?php  }?>
                                                                    <?php }?>
                                                                </select>
                                                            </div>
                                                            <div class="col-sm-1">
                                                                <select name="product_id[]" class="product_id" size="1">
                                                                    <option value="0">请选择产品类型</option>
                                                                </select>
                                                            </div>
                                                        </div>
                                                        <div class="form-group good_price_box">
                                                            <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 单价 </label>
                                                            <div class="col-sm-9 good_price_box_1">
                                                                <label style="padding-top: 7px;"> ¥
                                                                    <span class="good_price"></span>
                                                                </label>
                                                            </div>
                                                        </div>
                                                        <div class="form-group good_guige_box">
                                                            <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 规格 </label>
                                                            <div class="col-sm-9 good_guige_box_1">
                                                                <label style="padding-top: 7px;">
                                                                </label>
                                                            </div>
                                                        </div>
                                                        <div class="form-group good_gongyi_box">
                                                            <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 工艺 </label>
                                                            <div class="col-sm-9 good_gongyi_box_1">
                                                                <label style="padding-top: 7px;">
                                                                </label>
                                                            </div>
                                                        </div>
                                                        <div class="form-group good_num_box">
                                                            <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 数量 </label>
                                                            <div class="col-sm-9 good_num_box_1">
                                                                <input type="text" name="good_mum[]" class="rcol-xs-5 col-sm-1 good_mum" value="" price="">
                                                                &nbsp; &nbsp; &nbsp;
                                                                <label style="padding-top: 7px;">价格： ¥ <span class="total_good_price">0</span> </label>
                                                            </div>
                                                        </div>

                                                    </div>


                                                    <div class="col-md-offset-2 col-md-9" id="do_action">
                                                        <button class="btn btn-info" type="button" id="add_order_box">
                                                            <i class="icon-ok bigger-110"></i>
                                                            增加
                                                        </button>
                                                        &nbsp; &nbsp; &nbsp;
                                                        <button class="btn btn-info" type="submit" id="subForm1">
                                                            <i class="icon-ok bigger-110"></i>
                                                            提交
                                                        </button>
                                                        &nbsp; &nbsp; &nbsp;
                                                        <button class="btn" type="reset">
                                                            <i class="icon-undo bigger-110"></i>
                                                            重置
                                                        </button>
                                                    </div>
                                                </form>
                                                <!-- PAGE CONTENT ENDS -->
                                            </div><!-- /.col -->

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /section:settings.box -->
                <div class="row">

                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <?php $this->load->view('common/footer');?>
</div><!-- /.main-container -->
<div id="order_box_clone" style="display: none">
    <div class="space-4"></div>
    <div class="form-group">
        <label class="col-sm-1 control-label no-padding-right" for="form-field-2">选择产品</label>
        <div class="col-sm-1">
            <select name="category_id[]" class="category_id">
                <option value="0">请选择产品类型</option>
                <?php if(isset($cates)){?>
                    <?php foreach ($cates as $k => $v) {?>
                        <option value="<?php echo $v['id'] ?>"><?php echo $v['category_name'] ?></option>
                    <?php  }?>
                <?php }?>
            </select>
        </div>
        <div class="col-sm-1">
            <select name="product_id[]" class="product_id" size="1">
                <option value="0">请选择产品类型</option>
            </select>
        </div>
    </div>
    <div class="form-group good_price_box">
        <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 单价 </label>
        <div class="col-sm-9 good_price_box_1">
            <label style="padding-top: 7px;"> ¥
                <span class="good_price"></span>
            </label>
        </div>
    </div>
    <div class="form-group good_guige_box">
        <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 规格 </label>
        <div class="col-sm-9 good_guige_box_1">
            <label style="padding-top: 7px;">
            </label>
        </div>
    </div>
    <div class="form-group good_gongyi_box">
        <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 工艺 </label>
        <div class="col-sm-9 good_gongyi_box_1">
            <label style="padding-top: 7px;">
            </label>
        </div>
    </div>
    <div class="form-group good_num_box">
        <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 数量 </label>
        <div class="col-sm-9 good_num_box_1">
            <input type="text" name="good_mum[]" class="rcol-xs-5 col-sm-1 good_mum" value="" price="">
            &nbsp; &nbsp; &nbsp;
            <label style="padding-top: 7px;">价格： ¥ <span class="total_good_price"></span> </label>
        </div>
    </div>
</div>
<?php $this->load->view('common/footerjs');?>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {
        $("#add_order_box").click(function () {
            var addItem = $('#order_box_clone').children().clone(true).show();
            $('#do_action').before(addItem);
        });
        $("#tabs").tabs();
        $("#subForm1").click(function () {
            $("#from1").submit();
        });

    });
</script>
</body>
</html>
